package com.nebula.web;

import com.nebula.commons.modules.system.entity.SysRoleInfo;
import link.ahsj.core.components.tree.BusinessBuildUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Eastern unbeaten
 * @Email chenshiyun2011@163.com
 * @Date 2020/1/20 10:46 上午
 */
public class MainTest2 {


    public static void main(String[] args) {
        List<SysRoleInfo> depts = new ArrayList<>();
        depts.add(new SysRoleInfo("1111", "0000"));
        depts.add(new SysRoleInfo("22", "1111"));
        depts.add(new SysRoleInfo("33", "1111"));
        depts.add(new SysRoleInfo("2222", "22"));
        depts.add(new SysRoleInfo("3333", "22"));
        depts.add(new SysRoleInfo("4444", "33"));
        depts.add(new SysRoleInfo("5555", "33"));
        depts.add(new SysRoleInfo("222AAA", "2222"));
        depts.add(new SysRoleInfo("222BBB", "2222"));
        depts.add(new SysRoleInfo("555AAA", "5555"));
        depts.add(new SysRoleInfo("5555AAA", "5555"));
        SysRoleInfo dept = new SysRoleInfo("0000", "");
        dept.setNumberLevel(0);
        dept.setBusinessLevel("0000:");
        BusinessBuildUtils.rearrangement(dept, depts);
        depts.forEach(d -> {
            System.out.println(d.getId() + "     " + d.getPid() + "   " + d.getNumberLevel() + "       " + d.getBusinessLevel());
        });
    }


}
